* Apply to: roadmaps_1.dta
* Description:  Table A13 in Roadmaps

clear

set more off


use "...\1805 Roadmaps\roadmaps_1.dta", clear


* Treatment variables

gen con = 0
replace con = 1 if ctr_marlee!=.

gen vgd = 0
replace vgd = 1 if vgd_marlee!=.

gen pty = 0
replace pty = 1 if pty_marlee!=.

gen psi = 0
replace psi = 1 if psi_marlee!=.

gen psp = 0
replace psp = 1 if psp_marlee!=.

gen an3 = 0
replace an3 = 1 if end_marlee!=.
replace an3 = 1 if end_ideo_marlee!=.


gen all_info = 0
replace all_info = 1 if (vgd==1 | pty==1 | psi==1 | psp==1)


* Drop extraneous respondents

drop if an3==1
drop if (con==0 & vgd==0 & pty==0 & psi==0 & psp==0)
drop end_marlee end_ideo_marlee


* Demographic variables

gen female = 0
replace female = 1 if gender==2
replace female = . if gender==.

gen white = 0
replace white = 1 if race==1
replace white = . if race==.

gen lgbt = 0
replace lgbt = 1 if orient==2 | orient==3
replace lgbt = . if orient==.

gen homeowner = 0
replace homeowner = 1 if ownrent==1
replace homeowner = . if ownrent==.

gen democrat = 0
replace democrat = 1 if party=="Democrat"
replace democrat = . if party==""

gen pol_interest2 = 0
replace pol_interest2 = 1 if pol_interest==4
replace pol_interest2 = 2 if pol_interest==3
replace pol_interest2 = 3 if pol_interest==2
replace pol_interest2 = 4 if pol_interest==1
replace pol_interest2 = . if pol_interest==.

gen ret_level2 = 0
replace ret_level2 = 1 if ret_level==4
replace ret_level2 = 2 if ret_level==3
replace ret_level2 = 3 if ret_level==2
replace ret_level2 = 4 if ret_level==1
replace ret_level2 = . if ret_level==.


* Table A13
* Proportion of Respondents Who Are ...

* Female

ttest female if (con==1 | vgd==1), by(vgd)
ttest female if (con==1 | pty==1), by(pty)
ttest female if (con==1 | psi==1), by(psi)
ttest female if (con==1 | psp==1), by(psp)

ttest female if (vgd==1 | pty==1), by(vgd)
ttest female if (vgd==1 | psi==1), by(vgd)
ttest female if (vgd==1 | psp==1), by(vgd)

ttest female if (pty==1 | psi==1), by(pty)
ttest female if (pty==1 | psp==1), by(pty)

ttest female if (psi==1 | psp==1), by(psi)


* White

ttest white if (con==1 | vgd==1), by(vgd)
ttest white if (con==1 | pty==1), by(pty)
ttest white if (con==1 | psi==1), by(psi)
ttest white if (con==1 | psp==1), by(psp)

ttest white if (vgd==1 | pty==1), by(vgd)
ttest white if (vgd==1 | psi==1), by(vgd)
ttest white if (vgd==1 | psp==1), by(vgd)

ttest white if (pty==1 | psi==1), by(pty)
ttest white if (pty==1 | psp==1), by(pty)

ttest white if (psi==1 | psp==1), by(psi)


* Age

ttest age if (con==1 | vgd==1), by(vgd)
ttest age if (con==1 | pty==1), by(pty)
ttest age if (con==1 | psi==1), by(psi)
ttest age if (con==1 | psp==1), by(psp)

ttest age if (vgd==1 | pty==1), by(vgd)
ttest age if (vgd==1 | psi==1), by(vgd)
ttest age if (vgd==1 | psp==1), by(vgd)

ttest age if (pty==1 | psi==1), by(pty)
ttest age if (pty==1 | psp==1), by(pty)

ttest age if (psi==1 | psp==1), by(psi)


* LGBT

ttest lgbt if (con==1 | vgd==1), by(vgd)
ttest lgbt if (con==1 | pty==1), by(pty)
ttest lgbt if (con==1 | psi==1), by(psi)
ttest lgbt if (con==1 | psp==1), by(psp)

ttest lgbt if (vgd==1 | pty==1), by(vgd)
ttest lgbt if (vgd==1 | psi==1), by(vgd)
ttest lgbt if (vgd==1 | psp==1), by(vgd)

ttest lgbt if (pty==1 | psi==1), by(pty)
ttest lgbt if (pty==1 | psp==1), by(pty)

ttest lgbt if (psi==1 | psp==1), by(psi)


* Homeowner

ttest homeowner if (con==1 | vgd==1), by(vgd)
ttest homeowner if (con==1 | pty==1), by(pty)
ttest homeowner if (con==1 | psi==1), by(psi)
ttest homeowner if (con==1 | psp==1), by(psp)

ttest homeowner if (vgd==1 | pty==1), by(vgd)
ttest homeowner if (vgd==1 | psi==1), by(vgd)
ttest homeowner if (vgd==1 | psp==1), by(vgd)

ttest homeowner if (pty==1 | psi==1), by(pty)
ttest homeowner if (pty==1 | psp==1), by(pty)

ttest homeowner if (psi==1 | psp==1), by(psi)


* Democrat

ttest democrat if (con==1 | vgd==1), by(vgd)
ttest democrat if (con==1 | pty==1), by(pty)
ttest democrat if (con==1 | psi==1), by(psi)
ttest democrat if (con==1 | psp==1), by(psp)

ttest democrat if (vgd==1 | pty==1), by(vgd)
ttest democrat if (vgd==1 | psi==1), by(vgd)
ttest democrat if (vgd==1 | psp==1), by(vgd)

ttest democrat if (pty==1 | psi==1), by(pty)
ttest democrat if (pty==1 | psp==1), by(pty)

ttest democrat if (psi==1 | psp==1), by(psi)


* Education

ttest edu_level if (con==1 | vgd==1), by(vgd)
ttest edu_level if (con==1 | pty==1), by(pty)
ttest edu_level if (con==1 | psi==1), by(psi)
ttest edu_level if (con==1 | psp==1), by(psp)

ttest edu_level if (vgd==1 | pty==1), by(vgd)
ttest edu_level if (vgd==1 | psi==1), by(vgd)
ttest edu_level if (vgd==1 | psp==1), by(vgd)

ttest edu_level if (pty==1 | psi==1), by(pty)
ttest edu_level if (pty==1 | psp==1), by(pty)

ttest edu_level if (psi==1 | psp==1), by(psi)


* Income

ttest inc_level if (con==1 | vgd==1), by(vgd)
ttest inc_level if (con==1 | pty==1), by(pty)
ttest inc_level if (con==1 | psi==1), by(psi)
ttest inc_level if (con==1 | psp==1), by(psp)

ttest inc_level if (vgd==1 | pty==1), by(vgd)
ttest inc_level if (vgd==1 | psi==1), by(vgd)
ttest inc_level if (vgd==1 | psp==1), by(vgd)

ttest inc_level if (pty==1 | psi==1), by(pty)
ttest inc_level if (pty==1 | psp==1), by(pty)

ttest inc_level if (psi==1 | psp==1), by(psi)


* Political interest

ttest pol_interest2 if (con==1 | vgd==1), by(vgd)
ttest pol_interest2 if (con==1 | pty==1), by(pty)
ttest pol_interest2 if (con==1 | psi==1), by(psi)
ttest pol_interest2 if (con==1 | psp==1), by(psp)

ttest pol_interest2 if (vgd==1 | pty==1), by(vgd)
ttest pol_interest2 if (vgd==1 | psi==1), by(vgd)
ttest pol_interest2 if (vgd==1 | psp==1), by(vgd)

ttest pol_interest2 if (pty==1 | psi==1), by(pty)
ttest pol_interest2 if (pty==1 | psp==1), by(pty)

ttest pol_interest2 if (psi==1 | psp==1), by(psi)


* Political knowledge

ttest know_sco if (con==1 | vgd==1), by(vgd)
ttest know_sco if (con==1 | pty==1), by(pty)
ttest know_sco if (con==1 | psi==1), by(psi)
ttest know_sco if (con==1 | psp==1), by(psp)

ttest know_sco if (vgd==1 | pty==1), by(vgd)
ttest know_sco if (vgd==1 | psi==1), by(vgd)
ttest know_sco if (vgd==1 | psp==1), by(vgd)

ttest know_sco if (pty==1 | psi==1), by(pty)
ttest know_sco if (pty==1 | psp==1), by(pty)

ttest know_sco if (psi==1 | psp==1), by(psp)


* Ideology

ttest d1 if (con==1 | vgd==1), by(vgd)
ttest d1 if (con==1 | pty==1), by(pty)
ttest d1 if (con==1 | psi==1), by(psi)
ttest d1 if (con==1 | psp==1), by(psp)

ttest d1 if (vgd==1 | pty==1), by(vgd)
ttest d1 if (vgd==1 | psi==1), by(vgd)
ttest d1 if (vgd==1 | psp==1), by(vgd)

ttest d1 if (pty==1 | psi==1), by(pty)
ttest d1 if (pty==1 | psp==1), by(pty)

ttest d1 if (psi==1 | psp==1), by(psi)


* Local government performance

ttest ret_level2 if (con==1 | vgd==1), by(vgd)
ttest ret_level2 if (con==1 | pty==1), by(pty)
ttest ret_level2 if (con==1 | psi==1), by(psi)
ttest ret_level2 if (con==1 | psp==1), by(psp)

ttest ret_level2 if (vgd==1 | pty==1), by(vgd)
ttest ret_level2 if (vgd==1 | psi==1), by(vgd)
ttest ret_level2 if (vgd==1 | psp==1), by(vgd)

ttest ret_level2 if (pty==1 | psi==1), by(pty)
ttest ret_level2 if (pty==1 | psp==1), by(pty)

ttest ret_level2 if (psi==1 | psp==1), by(psi)


* Descriptive statistics

tabstat female, s(n mean sd)
tabstat white, s(n mean sd)
tabstat age, s(n mean sd)
tabstat lgbt, s(n mean sd)
tabstat homeowner, s(n mean sd)
tabstat democrat, s(n mean sd)
tabstat edu_level, s(n mean sd)
tabstat inc_level, s(n mean sd)
tabstat pol_interest2, s(n mean sd)
tabstat know_sco, s(n mean sd)
tabstat d1, s(n mean sd)
tabstat ret_level2, s(n mean sd)

* End
